package interpreter.example;

/**
 * @author cheng:
 * @date 2019/4/26 15:08
 */
public class TerminalFactory {
    public static Expression createExpression(String flag){
        Expression expression  = null;
        switch (flag){
            case "O":
                expression = new Scale();
                break;
            case "C":
            case "D":
            case "E":
            case "F":
            case "G":
            case "A":
            case "B":
            case "P":
                expression = new Note();
                break;
            case "T":
                expression = new Speed();
                break;
            default:
        }
        return expression;
    }
}
